<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="panel panel-default panel-intro">
        <div class="panel-heading">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#first" data-toggle="tab">{:__('Basic Data')}</a></li>
                <li><a href="#second" data-toggle="tab">{:__('Stock/Specs')}</a></li>
            </ul>
        </div>
        <div class="panel-body">
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade active in" id="first">

                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_name')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-goods_name" data-rule="required" class="form-control form-control" name="row[goods_name]" type="text" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Pro_no')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-pro_no" class="form-control" name="row[pro_no]" type="text" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="c-pid" class="control-label col-xs-12 col-sm-2">{:__('Category')}:</label>
                        <div class="col-xs-12 col-sm-8">

                            <select id="c-pid" data-rule="required" class="form-control selectpicker" name="row[category_id]">
                                {foreach name="parentList" item="vo"}
                                <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo.name}</option>
                                {/foreach}
                            </select>

                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <div class="input-group">
                                <input id="c-images" data-rule="required" class="form-control form-control" size="50" name="row[images]" type="text">
                                <div class="input-group-addon no-border no-padding">
                                    <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                                </div>
                                <span class="msg-box n-right" for="c-images"></span>
                            </div>
                            <ul class="row list-inline plupload-preview" id="p-images"></ul>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <textarea id="c-content" data-rule="required" class="form-control editor form-control" rows="5" name="row[content]" cols="50"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Long')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-long" class="form-control" step="0.1" name="row[long]" type="number">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Wide')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-wide" class="form-control" step="0.1" name="row[wide]" type="number">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('High')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-high" class="form-control" step="0.1" name="row[high]" type="number">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Weight')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-weight" class="form-control" step="0.1" name="row[weight]" type="number">
                        </div>
                    </div>
<!--                    <div class="form-group">-->
<!--                        <label class="control-label col-xs-12 col-sm-2">{:__('Deduct_stock_type')}:</label>-->
<!--                        <div class="col-xs-12 col-sm-8">-->

<!--                            <select  id="c-deduct_stock_type" data-rule="required" class="form-control selectpicker" name="row[deduct_stock_type]">-->
<!--                                {foreach name="deductStockTypeList" item="vo"}-->
<!--                                <option value="{$key}" {in name="key" value="20"}selected{/in}>{$vo}</option>-->
<!--                                {/foreach}-->
<!--                            </select>-->

<!--                        </div>-->
<!--                    </div>-->
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Sales_initial')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-sales_initial" data-rule="required" class="form-control form-control" name="row[sales_initial]" type="number" value="0">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Sales_actual')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-sales_actual" data-rule="required" class="form-control form-control" name="row[sales_actual]" type="number" value="0">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Grade')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-grade" data-rule="required" class="form-control form-control" name="row[grade]" type="number" value="0">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
                        <div class="col-xs-12 col-sm-8">

                            <select  id="c-flag" class="form-control selectpicker" multiple="" name="row[flag][]">
                                {foreach name="flagList" item="vo"}
                                <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                                {/foreach}
                            </select>

                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_sort')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-goods_sort" data-rule="required" class="form-control form-control" name="row[goods_sort]" type="number" value="100">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('On sale time')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-starttime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[starttime]" type="text" value="{:date('Y-m-d H:i:s')}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Goods removed time')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-endtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[endtime]" type="text" value="{:date('Y-m-d H:i:s')}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_status')}:</label>
                        <div class="col-xs-12 col-sm-8">

                            <div class="radio">
                                {foreach name="goodsStatusList" item="vo"}
                                <label for="row[goods_status]-{$key}"><input id="row[goods_status]-{$key}" name="row[goods_status]" type="radio" value="{$key}" {in name="key" value="10"}checked{/in} /> {$vo}</label>
                                {/foreach}
                            </div>

                        </div>
                    </div>

                </div>

                <div class="tab-pane fade" id="second">

                    <!-- 商品规格属性 start -->
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Spec_type')}:</label>
                        <div class="col-xs-12 col-sm-8">

                            <select  id="c-spec_type" data-rule="required" class="form-control selectpicker" name="row[spec_type]">
                                {foreach name="specTypeList" item="vo"}
                                <option value="{$key}" {in name="key" value="10"}selected{/in}>{$vo}</option>
                                {/foreach}
                            </select>

                        </div>
                    </div>
                    <div class="goods-spec-many form-group">
                        <!-- <label class="control-label col-xs-12 col-sm-2"></label>-->
                        <div class="goods-spec-box col-xs-12 col-sm-11" style="background-color: white;">
                            <!-- 规格属性 -->
                            <div class="spec-attr"></div>

                            <!-- 添加规格：按钮 -->
                            <div class="spec-group-button">
                                <button type="button" class="btn-addSpecGroup btn btn-xs btn-success">{:__('Add specifications')}</button>
                            </div>

                            <!-- 添加规格：表单 -->
                            <div class="spec-group-add">
                                <div class="spec-group-add-item form-group">
                                    <label class="control-label form-require">{:__('Specification name')} </label>
                                    <input type="text" class="input-specName tpl-form-input"
                                           placeholder="{:__('Specification name')}">
                                </div>
                                <div class="spec-group-add-item form-group">
                                    <label class="control-label form-require">{:__('Specification value')} </label>
                                    <input type="text" class="input-specValue tpl-form-input"
                                           placeholder="{:__('Specification value')}">
                                </div>
                                <div class="spec-group-add-item margin-top">
                                    <button type="button" class="btn-addSpecName btn btn-xs btn-success"> {:__('OK')}
                                    </button>
                                    <button type="button" class="btn-cancleAddSpecName btn btn-xs btn-default"> {:__('Reset')}
                                    </button>
                                </div>
                            </div>
                            <!-- 商品多规格sku信息 -->
                            <div class="goods-sku scrollable-horizontal">
                                <!-- 分割线 -->
                                <div class="goods-spec-line"></div>
                                <!-- sku 批量设置 -->
                                <div class="spec-batch form-inline">
                                    <div class="form-group">
                                        <label class="control-label">{:__('Batch Settings')}</label>
                                    </div>
                                    <div class="form-group">
                                        <input type="text" data-type="goods_no" placeholder="{:__('Goods_no')}">
                                    </div>
                                    <div class="form-group">
                                        <input type="number" data-type="goods_price" placeholder="{:__('Goods_price')}">
                                    </div>
                                    <div class="form-group">
                                        <input type="number" data-type="line_price" placeholder="{:__('Line_price')}">
                                    </div>
                                    <div class="form-group">
                                        <input type="number" data-type="cost_price" placeholder="{:__('Cost_price')}">
                                    </div>
                                    <div class="form-group">
                                        <input type="number" data-type="stock_num" placeholder="{:__('Stock_num')}">
                                    </div>
                                    <div class="form-group">
                                        <button type="button" class="btn-specBatchBtn btn btn-sm btn-secondary
                         radius">{:__('OK')}
                                        </button>
                                    </div>
                                </div>
                                <!-- sku table -->
                                <table class="spec-sku-tabel table table-bordered table-centered margin-bottom-xs text-nowrap"></table>
                            </div>
                        </div>
                    </div>

                    <div class="goods-spec-single">
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Goods_no')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-goods_no" class="form-control form-control" name="spec[goods_no]" type="text" value="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Goods_price')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-goods_price" data-rule="required" class="form-control form-control" name="spec[goods_price]" type="number" value="0">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Line_price')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-line_price" class="form-control form-control" name="spec[line_price]" type="number" value="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Cost_price')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-cost_price" class="form-control form-control" name="spec[cost_price]" type="number" value="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-xs-12 col-sm-2">{:__('Stock_num')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-stock_num" class="form-control form-control" name="spec[stock_num]" type="number" value="100">
                            </div>
                        </div>
                    </div>
                    <!-- 商品规格属性 end -->

                </div>
            </div>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
{include file="litestore/litestoregoods/spec_many_template" /}

<link rel="stylesheet" href="__CDN__/assets/addons/litestore/css/litestoregoods.css">